﻿using System;
using System.Windows;
using System.Windows.Input;

namespace Billing.Windows
{
    /// <summary>
    /// Interaction logic for CakeBooking.xaml
    /// </summary>
    public partial class CakeBooking : Window
    {
        public CakeBooking()
        {
            InitializeComponent();
        }

        private void Window_KeyUp(object sender, KeyEventArgs e)
        {
            try
            {
                if (e.Key == Key.B)
                {
                    BookCake bc = new BookCake();
                    bc.Owner = this;
                    bc.ShowDialog();
                }
                else if (e.Key == Key.U)
                {
                    UpdateCake uc = new UpdateCake();
                    uc.Owner = this;
                    uc.ShowDialog();
                }
                else if (e.Key == Key.M)
                {
                    PayBalance pb = new PayBalance();
                    pb.Owner = this;
                    pb.ShowDialog();
                }
                else if (e.Key == Key.S)
                {
                    SearchCakes cake = new SearchCakes();
                    cake.Owner = this;
                    cake.ShowDialog();
                }
                else if (e.Key == Key.C)
                {
                    CancelBookedCake cancelCake = new CancelBookedCake();
                    cancelCake.Owner = this;
                    cancelCake.ShowDialog();
                }
                else if (e.Key == Key.Escape)
                {
                    this.Close();
                }
            }
            catch (Exception) { }
        }
    }
}
